/****************************************************************************
 * from libwiigui Template
 * Tantric 2009
 *
 * newiice 2009
 * main.cpp
 ***************************************************************************/
#include "netdebug.h"
#include "main.h"



FreeTypeGX *fontSystem;
int ExitRequested = 0;

void ExitApp(){
	ShutoffRumble();
	StopGX();
	exit(0);
}

int main(int argc, char *argv[]){
	nd_connect();
	PAD_Init();
	WPAD_Init();
	InitVideo(); // Initialise video
	InitAudio(); // Initialize audio
	// read wiimote accelerometer and IR data
	WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
	WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);

	// Initialize font system
	fontSystem = new FreeTypeGX();
	fontSystem->loadFont(font_ttf, font_ttf_size, 0);
	fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);

	InitGUIThreads();

	MainMenu(MENU_MAIN);
}
